package cn.com.hatech.cdkey.common.exception;

import lombok.Data;

/**
 * @projectName: hatech-blog
 * @package: cn.com.hatech.blog.common.exception
 * @className: TipException
 * @author: xuruikai
 * @description: 自定义业务异常
 * @date: 2020/1/11 14:27
 * @version: 1.0
 */
@Data
public class TipException extends RuntimeException {

    private String msg;

    private int code = 500;

    private Object data;

    public TipException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public TipException(String msg, Object data) {
        super(msg);
        this.msg = msg;
        this.data = data;
    }

    public TipException(int code, String msg) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public TipException(int code, String msg, Object data) {
        super(msg);
        this.code = code;
        this.data = data;
    }

}
